package com.ashapo.pattern.pattern014command;

//第5步
//使用Broker类来接收和执行命令。

public class CommandPatternDemo {

    /**
     * 命令模式
     * @param args
     */
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}